<?php
namespace common\sources\read\loginpower;

use common\models\craftsman\loginpower;

class LoginPowerAccess  implements ILoginPowerAccess
{
    public function getSubIndex()
    {
        $result = loginpower::find()
            ->select("powerid,pid_index,title,sub_index,sub_title,requstUrl")
            ->asArray()
            ->all();
        return $result;
    }

    //获取登录用户的权限
    public function viewSubIndex($all_power)
    {
        $result = loginpower::find()
            ->select("powerid,pid_index,title,sub_index,sub_title,requstUrl")
            ->where(['powerid' => $all_power])
            ->asArray()
            ->all();
        return $result;
    }
}